/*
 ============================================================================
 Name		: YuebaoFavoriteCanvasMyMagazineContentPanel.h
 Author	  : wangchao
 Version	 : 1.0
 Copyright   :
 Description : MyMagazineContentPanel declaration
 ============================================================================
 */

#ifndef YUEBAOFAVORITECANVASMYMAGAZINEContentPanel_H
#define YUEBAOFAVORITECANVASMYMAGAZINEContentPanel_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include "YuebaoTabControl.h"
#include "fFramework.h"
#include "fListbox.h"
#include "YuebaoMagazineItem.h"
#include "fDialog.h"
#include "YuebaoFavoriteTabControl.h"

// CLASS DECLARATION
/**
 *  MyMagazineContentPanel
 *
 */
class MyMagazineListboxContentControl;
class MyMagazineContentPanel : public fTabContentControl,
        public fTabControlObserver,
        public fListboxEventObserver,
        public MDialogEventObserver
{
public:
    // Constructors and destructor

    /**
     * Destructor.
     */
    ~MyMagazineContentPanel( );

    /**
     * Two-phased constructor.
     */
    static MyMagazineContentPanel* NewL( fEngine * aEngine, TRect rect );

    /**
     * Two-phased constructor.
     */
    static MyMagazineContentPanel* NewLC( fEngine * aEngine, TRect rect );

private:

    /**
     * Constructor for performing 1st stage construction
     */
    MyMagazineContentPanel( );

    /**
     * EPOC default constructor for performing 2nd stage construction
     */
    void ConstructL( fEngine * aEngine, TRect rect );
public:
    virtual void TabChanged( int active_index, int deactive_index );
    virtual void TabNotHandleKeyEvent( f_KEY_DES * aKeyDes );
    virtual void Active( );
    virtual void Deactive( );
    virtual void GetFocused( );
    virtual void LostFocuse( );
public:
    virtual void RenderFrame( );
    virtual void HandleKey( f_KEY_DES * aKeyDes );
    TInt HandleMouse( fMouseEvent nType, TPoint sPoint );
protected:
    YuebaoFavoriteTabControl* _tabControl;
    MyMagazineListboxContentControl* _unread_listbox;
    MyMagazineListboxContentControl* _readed_listbox;
protected:
    void ListboxItemClicked( fListbox* pListBox, int selectIndex, fListBoxItem* pItemInfo );
public:
protected:
    RPointerArray< YuebaoMagazineItem > _unread;
    RPointerArray< YuebaoMagazineItem > _readed;
protected:
    void HandleReturnEvent( fDialog* aObject, TReturnValue aValue );
public:
    void ReloadListbox( );
public:
    fToolbar* _commandbar;
};

#endif // YUEBAOFAVORITECANVASMYMAGAZINEContentPanel_H
